import Vue from 'vue'
import App from './App.vue'
import VueRouter from "vue-router"
Vue.use(VueRouter)
import UIRouter from "./views/UI_router.vue"
import Contacts from "./views/Contacts.vue"
import About from "./views/About.vue"

// 二级页面
import AllContacts from "./views/child/All_contacts.vue"
import Alice from "./views/child/Alice.vue"
import Bob from "./views/child/Bob.vue"

// 三级页面
import Blog from "./views/child/child2/Blog.vue"
import Fax from "./views/child/child2/Fax.vue"

const routes = [
  {
    path: "/",
    redirect: "/uirouter"
  },
  {
    path: "/uirouter",
    component: UIRouter
  },
  {
    path: "/contacts",
    component: Contacts,
    children: [
      {
        path: "allcontacts",
        component: AllContacts
      },
      {
        path: "alice",
        component: Alice
      },
      {
        path: "bob",
        component: Bob,
        children: [
          {
            path: "blog",
            component: Blog
          },
          {
            path: "fax",
            component: Fax
          },
        ]
      },
    ]
  },
  {
    path: "/about",
    component: About
  },
]
const router = new VueRouter({
  routes
})
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
